﻿@using System.Web.SessionState
@using EpiInfoCloudMagpiBridge.Controllers
@using EpiInfoCloudMagpiBridge.Models

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")



</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top" style="position:relative">
        <div class="container">

            <div class="navbar-header">
                
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <img src="~/Images/epiIcon.png" alt="Epi Info" width="50" height="Auto" style="padding:5px; display:none" />
                @Html.ActionLink("Epi Info Cloud Magpi Bridge", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            @{ if (ApplicationModel.LoggedOn)
             {
                <div style="float:right" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav" id="menu" style="margin-left:60px">

                        @{
                 if (HelperFunctions.UserHasAzureServices() && HelperFunctions.UserHasMagpiServices())
                 {
                    <li>@Html.ActionLink("Download Responses", "Index", "DownloadResponse", new { area = "" }, null)</li>

                 }
                @*if (HelperFunctions.UserHasMagpiServices())
                    //     if (HelperFunctions.UserHasMagpiServices()  && HelperFunctions.UserHasMagpiServices())
                    {
                       <li>@Html.ActionLink("Manage Registered Datasets ", "Index", "MagpiAzureMapping", new { area = "" }, null)</li>
                    }*@
                 if (HelperFunctions.UserHasMagpiServices())
                 {
                    <li>@Html.ActionLink("Manage Registered Datasets ", "Index", "MagpiAzureMapping", new { area = "" }, null)</li>
                 }
                        }

                        <li class="dropdown">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                Settings <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li>@Html.ActionLink("Manage Azure Credentials ", "Index", "AzureMobileServiceSettings", new { area = "" }, null)</li>
                                <li>@Html.ActionLink("Manage Magpi Credentials ", "Index", "MagpiAccountSettings", new { area = "" }, null)</li>
                            </ul>
                        </li>
                    </ul>
                </div>



                
             }
            }


        </div>
    </div>

    <div style="background-color: #818181; margin-top:-20px">
        <div class="container body-content">
            <div style="width: 280px;float: right;">
                <table>
                    <tr>
                        @{
                            if (ApplicationModel.LoggedOn)
                            {
                                <td>
                                    <span style="color: #ffffff; font-weight:bold;">Welcome @ApplicationModel.CurrentEwavUserId  </span>

                                </td>
                                <td>
                                    @using (Html.BeginForm("LogOff", "Login", FormMethod.Post, new { id = "logoutForm" }))
                                    {
                                        @Html.AntiForgeryToken()
                                        <button submit="submit" style="font-weight: bold;margin-top:0px; width:60px; height:30px;font-size:12px; border:0px solid; color: #ffffff; text-decoration: underline; background: none!important">Log off</button>
                                        @*<button class="btn btn-primary" submit="submit">Log off</button>*@
                                    }
                                </td>
                            }
                        }
                 
                    </tr>
                </table>
            </div>
        </div>
    </div>


    <div class="container body-content">
        <div style="height:400px">
            @RenderBody()
        </div>
        <hr />
        <footer>
            
            @*<p style="font:x-small">@System.Reflection.Assembly.GetExecutingAssembly().GetName().Version</p>*@
            <p>&copy; @DateTime.Now.Year - Epi Info Cloud Platform&trade; </p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/Scripts/menu.js")
    @RenderSection("scripts", required: false)
</body>
</html>
